package com.lndsnx.callback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @Description Rabbit 配置
 * @Author lndsnx
 * @Date 2025/7/30 上午9:50
 */
@Slf4j
public class RabbitConfirmCallback implements RabbitTemplate.ConfirmCallback {

    /**
     * 实现ConfirmCallback接口的confirm方法，用于处理消息确认回调
     * @param correlationData 消息关联数据
     * @param ack 消息是否成功确认
     * @param cause 确认失败的原因
     */
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        log.info("MessageConfirm correlationData: {}, ack: {}, cause: {}", correlationData, ack, cause);
    }
}
